<? if (isset($title)):?>
	<div class="headed"><?=$title?></div>
<? endif;?>
<? if (isset($entry)):

/* CATEGORIES
*************************************************/
	if (isset($categories) && is_arr($categories)):?>
	<div class="categoriesDiv">
	<? foreach ($categories as $categoryId=>$category):
		if (isset($page)):
		?>
		<a href="/<?=$page->pUrl?>/category/<?=$categoryId?>" class="categoriesDivLink<?=((isset($activeCategory->id) && ($categoryId == $activeCategory->id))?' activeCategory':'')?>">
			<?=$category?>
		</a>
	<? endif; endforeach;?>
	</div>
	<? endif;

/* ARTICLES
*************************************************/
	if (isset($page) && $page->pType2 == 1)
	{
		$expEntries = array();
		if (!$page->pSize2)
			$page->pSize2 = 1;
		$width = floor(100 / $page->pSize2);
		foreach ($entry as $key=>$en):
			ob_start();
		?>
			<div class="entryDivTable">
				<div class="entryMainDiv">
					<h3 class="entryDivHeading"><a href="/<?=$blogs[$en->tBlog]->pUrl?>/<?=$en->pUrl?>" class="entryDivMainLink"><?=$en->pName?></a> </h3>
					<? if (!empty($en->pImg)):?>
						<a href="/<?=$blogs[$en->tBlog]->pUrl?>/<?=$en->pUrl?>" class="entryDivMainImgLink">
							<img src="/uploads/articles/<?=$en->id?>/thumb200/<?=$en->pImg?>" class="entryDivMainImg"/>
						</a>
					<? endif; ?>
					<div class="entryDivSpanText">
						<?=$en->pShortText?>
					</div>
				</div>
				<div class="entryDivInfo">

					<span class="entryDateSpan">
						<?=printDate($en->dCreated)?>
					</span>

					<span class="entryAuthorSpan">
						<?=$users[$en->tUserCreated]?>
					</span>

					<?
					if (!empty($en->tCategory)):
						foreach ($en->tCategory as $val):
							if (isset($categories[$val])): ?>
								<a class="entryDivCategory" href="/<?=$blogs[$en->tBlog]->pUrl?>/category/<?=$val?>">
									<?=(((isset($page) && $page->pType == 2) || empty($page))?$blogs[$en->tBlog]->pName.'/':'').$categories[$val]?>
								</a>
							<? endif;?>
						<? endforeach;?>
					<? endif;?>
				</div>
			</div>

			<? /*if ($key % $page->pSize2 == ($page->pSize2 - 1) ): ?>
				</tr> <tr>
			<? endif; */
			if (empty($expEntries[$key % $page->pSize2]))
				$expEntries[$key % $page->pSize2] = '';
			$expEntries[$key % $page->pSize2] .= ob_get_clean();
			endforeach;
		?> <table> <tr> <?
		foreach ($expEntries as $val): ?>
		<td class="entryTD" style="width: <?=$width?>%">
			<?=$val?>
		</td>
		<? endforeach; ?>
		</tr> </table> <?
	}
	else
	{
		foreach ($entry as $en):?>
		<div class="entryDiv">
			<div class="entryMainDiv">
				<h3 class="entryDivHeading"><a href="/<?=$blogs[$en->tBlog]->pUrl?>/<?=$en->pUrl?>" class="entryDivMainLink"><?=$en->pName?></a></h3>
				<? if (!empty($en->pImg)):?>
					<a href="/<?=$blogs[$en->tBlog]->pUrl?>/<?=$en->pUrl?>" class="entryDivMainImgLink">
						<img src="/uploads/articles/<?=$en->id?>/thumb200/<?=$en->pImg?>" class="entryDivMainImg"/>
					</a>
				<? endif; ?>
				<div class="entryRightDiv">
					<div class="entryDivSpanText">
						<?=$en->pShortText?>
						<br>
						<a href="/<?=$blogs[$en->tBlog]->pUrl?>/<?=$en->pUrl?>" class="entryDivSpanReadMoreLink">(Читать далее)</a>
					</div>
				</div>
			</div>
			<div class="entryDivInfo">

				<span class="entryDateSpan">
					<?=printDate($en->dCreated)?>
				</span>

				<span class="entryAuthorSpan">
					<?=$users[$en->tUserCreated]?>
				</span>

				<?
				if (!empty($en->tCategory)):
					foreach ($en->tCategory as $val):
						if (isset($categories[$val])): ?>
							<a class="entryDivCategory" href="/<?=$blogs[$en->tBlog]->pUrl?>/category/<?=$val?>">
								<?=(((isset($page) && $page->pType == 2) || empty($page))?$blogs[$en->tBlog]->pName.'/':'').$categories[$val]?>
							</a>
						<? endif;?>
					<? endforeach;?>
				<? endif;?>
			</div>
		</div>
		<?	endforeach;
	} ?>
<? /* PAGINATION
*************************************************/?>
	<? if (!empty($pagination)):?>
		<div class="paginationDiv">
			<?=$pagination?>
		</div>
	<? endif;?>
<? endif;?>